/**
 * @description: 管理员帐号
 */

import { defHttp } from '../http'
import type { CommonAPI } from '../schema/all'
/**
 * @description: 用户
 */

/** 创建用户 */
export const addAdminApiUserCreateApi: CommonAPI<
  '/admin/api/user/create',
  'post'
> = (data) => defHttp.post(`/admin/api/user/create`, { data })

/** 删除用户 */
export const deleteAdminApiUserDeleteApi: CommonAPI<
  '/admin/api/user/delete',
  'delete'
> = (data) => defHttp.delete(`/admin/api/user/delete`, { data })

/** 获取用户详情 */
export const getAdminApiUserDetailApi: CommonAPI<
  '/admin/api/user/detail',
  'get'
> = (params) => defHttp.get(`/admin/api/user/detail`, { params })

/** 重置用户密码 */
export const updateAdminApiUserPasswordApi: CommonAPI<
  '/admin/api/user/password',
  'put'
> = (data) => defHttp.put(`/admin/api/user/password`, { data })

/** 更新用户状态 */
export const updateAdminApiUserStatusApi: CommonAPI<
  '/admin/api/user/status',
  'put'
> = (data) => defHttp.put(`/admin/api/user/status`, { data })

/** 更新用户信息 */
export const updateAdminApiUserUpdateApi: CommonAPI<
  '/admin/api/user/update',
  'put'
> = (data) => defHttp.put(`/admin/api/user/update`, { data })

/** 获取用户列表 */
export const getAdminApiUsersListApi: CommonAPI<'/admin/api/users', 'get'> = (
  params
) => defHttp.get(`/admin/api/users`, { params })
